package com.spider.configure;

import com.spider.BilibiliRankSpider;
import com.spider.mapper.BilibiliRankMapper;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.io.IOException;

/**
 * Created by Lisy on 2018/10/9.
 */
@Service
public class BilibiliSpiderScheduled {

    @Resource
    private BilibiliRankSpider bilibiliRankSpider;

    @Scheduled(cron = "0 0 2 * * ?")
    public void run() throws IOException {
        bilibiliRankSpider.fetchRank();
    }

}
